#include "Elab.h"
#include <string>

Elab::Elab()
{
	m_title = "";
     m_Name = "";
	m_Time_Start.Now();
}

Elab::Elab(const Elab& elab) :
    m_Name( elab.m_Name ),
    m_title( elab.m_title ),
    m_Time_Start( elab.m_Time_Start ),
    m_Time_End ( elab.m_Time_End)
{
}

Elab::Elab(
        const string& name,
        const string& title,
        const  PTime& t_start,
        const  PTime& t_end
        ):
    m_Name( name ),
    m_title( title ),
    m_Time_Start( t_start ),
    m_Time_End ( t_end )
{
}

Elab& Elab::operator = ( const Elab& elab )
{
    m_Name = elab.m_Name;
    m_title = elab.m_title;
    m_Time_Start = elab.m_Time_Start;
    m_Time_End = elab.m_Time_End;
    return *this;
}

Elab::Elab(const string& title)
{
	m_title = title;
	m_Time_Start.Now();
}

void Elab::setTimeStartNow(void)
{
	m_Time_Start.Now();
}

void Elab::setTimeEndNow(void)
{
	m_Time_End.Now();
}

PTime Elab::getTimeStart(void) const
{
        return(m_Time_Start);
}

PTime Elab::getTimeEnd(void) const
{
        return(m_Time_End);
}

void Elab::setTitle(const string& title)
{
	m_title = title;
}

void Elab::setName(const string& name)
{
        m_Name = name;
}

string Elab::getTitle(void) const
{
	return(m_title);
}

string Elab::getName(void) const
{
        return(m_Name);
}

void Elab::PPrn(Page& p_buff)
{
	string s;
	p_buff.add_line("ELABORAZIONE");
	p_buff.add_line("============");
        s.append("         Titolo = "); s.append(m_title);
	p_buff.add_line(s);
	s.erase();
        s.append("           Nome = "); s.append(m_Name);
        p_buff.add_line(s);
        s.erase();
	s.append("Data esecuzione = "); s.append(m_Time_Start.StrDate());
	p_buff.add_line(s);
	s.erase();
        s.append(" Ora esecuzione = "); s.append(m_Time_Start.StrTime());
	p_buff.add_line(s);
	s.erase();
}








